package com.jk.common.neutronAI;

import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StreamUtils;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

/**
 * Description: PromptFileUtil
 * Author: 豆子高
 * Date: 2025/4/18 16:12
 */
public class PromptFileUtil {

    public static String getPromptFileByAgentType(String filePath) {
        ClassPathResource classPathResource = new ClassPathResource(filePath);
        try (InputStream inputStream = classPathResource.getInputStream()) {
            return StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8);
        } catch (IOException e) {
            throw new RuntimeException("读取文件失败", e);
        }
    }

}
